<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>求阶乘</title>
	</head>

	<body>
		<script type="text/javascript">
			var a = prompt("请输入所求数的阶乘")
			var num = document.getElementById("a");
			var re = 1;
			for(var i = 1; i <= a; i++) {
				re *= i;
			}
			document.write(re);
		</script>
	</body>

</html>